package com.aqielife.demo.elasticsearch.entity;

import cn.easyes.annotation.HighLight;
import cn.easyes.annotation.IndexField;
import cn.easyes.annotation.IndexId;
import cn.easyes.annotation.rely.Analyzer;
import cn.easyes.annotation.rely.FieldType;
import cn.easyes.annotation.rely.IdType;
import lombok.Data;

/**
 * @description: TODO
 * @author: aqie
 * @create: 2023-03-11 13:34
 **/
@Data
public class EsDoc {
    @IndexId(type = IdType.CUSTOMIZE)
    private String id;

    private String fileId;

    private Integer fileSize;

    @IndexField(fieldType = FieldType.TEXT, analyzer = Analyzer.IK_SMART, searchAnalyzer = Analyzer.IK_SMART)
    private Integer fileName;

    @IndexField(fieldType = FieldType.KEYWORD, analyzer = Analyzer.IK_SMART, searchAnalyzer = Analyzer.IK_SMART)
    private String fileType;

    @HighLight(mappingField = "highlightContent", fragmentSize = 2)
    @IndexField(fieldType = FieldType.TEXT, analyzer = Analyzer.IK_SMART, searchAnalyzer = Analyzer.IK_SMART)
    private String content;
}
